
<?php
session_start();
include 'inc/db_connect.php';

$get_cities_sql = "select id, city from china_cities";
$query_cities = mysql_query($get_cities_sql);
$city_num = mysql_num_rows($query_cities);

echo 'city_num:'.$city_num.'.';

for($i=0; $i < $city_num; $i++) {
  $city_row = mysql_fetch_array($query_cities);
  $update_sql = "update project_info set customer_location = '".$city_row['city'];
  $update_sql .= "' where project_name like '%".$city_row['city']."%'";
  mysql_query($update_sql);
//  echo $update_sql; 
}

//$get_proj_sql = "select id, project_name from project_info";
//$query_proj = mysql_query($get_proj_sql);
//$proj_num = mysql_num_rows($query_proj);

//echo 'proj_num:'.$proj_num.'.';


?>
